from datetime import datetime

from sqlalchemy import Column, String, Integer, DateTime, Float

from api.utils.base import Base


class Task(Base):
    __tablename__ = "t_task"
    id = Column(String, primary_key=True)
    doc_id = Column(String, comment="文档ID")
    from_page = Column(Integer, comment="起始页")
    to_page = Column(Integer, comment="结束页")
    task_type = Column(String, comment="任务类型")
    priority = Column(Integer, comment="优先级")
    begin_at = Column(DateTime, comment="开始时间")
    process_duration = Column(Float, comment="处理时长")
    progress = Column(Float, comment="进度")
    progress_msg = Column(String, comment="进度消息")
    retry_count = Column(Integer, comment="重试次数")
    digest = Column(String, comment="摘要")
    chunk_ids = Column(String, comment="分块ID集合")